import 'package:flutter/material.dart';
import 'package:trip_flutter/pages/home_page.dart';

class NavigatorUtil {
  static late BuildContext _context;

  static updateContext(BuildContext context) {
    _context = context;
  }

  static goHomePage(BuildContext context) {
    Navigator.pushReplacement(
        context, MaterialPageRoute(builder: (context) => HomePage()));
  }

  static goPage(Widget page) {
    Navigator.pushReplacement(
        _context, MaterialPageRoute(builder: (context) => page));
  }
}
